package com.yxlcommon.common.mapper;



import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yxlcommon.common.pojo.Category;

import java.util.List;

public interface CategoryMapper extends BaseMapper<Category> {

    List<Category> selectAllByCategories(Integer parentId);

    List<Category> selectHotFirstLevelCategories();

    List<Category> selectNewFirstLevelCategories();

    List<Category> selectSecondLevelCategories();

    IPage<Category> selectAllCategory(Page<Category> categoryPage, Integer categoryLevel);

    Integer insertCategory(String categoryName, Integer categoryLevel, Integer parentId);

    Integer selectRootCategory(Integer categoryId);
}
